import request from '@/router/axios';
import config from '@/config/website'

//列表
export const productPriceList = (current, size, equipment) => {
    return request({
        url: '/api/blade-sale/productprice/page',
        method: 'get',
        params: {
            current,
            size,
            ...equipment
        }
    })
}


//新建
export const productPriceAdd = (data) => {
    return request({
        url: '/api/blade-sale/productprice/save',
        method: 'post',
        data
    })
}
//修改
export const productPriceUpdate = (data) => {
    return request({
        url: '/api/blade-sale/productprice/update',
        method: 'post',
        data
    })
}
//查看
export const productPriceView = (id) => {
    return request({
        url: '/api/blade-sale/productprice/detail',
        method: 'get',
        params: {
            id
        }
    })
}

//删除
export const productPriceDel = (ids) => {
    return request({
        url: '/api/blade-sale/productprice/remove',
        method: 'post',
        params: {
            ids
        }
    })
}

//产品要求
export const priceList = (customerId) => {
    return request({
        url: '/api/blade-sale/productprice/getProjectList',
        method: 'get',
        params: {
            customerId
        }
    })
}
export const priceSave = (data) => {
    return request({
        url: '/api/blade-sale/productpricesub/update',
        method: 'post',
        data
    })
}
//提交
export const productPriceSubmit = (id) => {
    return request({
        url: '/api/blade-sale/productprice/start-process',
        method: 'post',
        params: {
            id,
        }
    })
}
//产品要求子表
export const priceBotList = (productPriceId, equipment) => {
    return request({
        url: '/api/blade-sale/productpricesub/list',
        method: 'get',
        params: {
            productPriceId,
            ...equipment
        }
    })
}
//子表修改
export const priceUpdate = (data) => {
    return request({
        url: '/api/blade-sale/productpricesub/update',
        method: 'post',
        data
    })
}
//子表删除
export const priceDel = (ids) => {
    return request({
        url: '/api/blade-sale/productpricesub/remove',
        method: 'post',
        params: {
            ids
        }
    })
}